<template>
  <div>
    <div ref="aaa" class="aaa"></div>
  </div>
</template>

<script>
export default {
  methods: {
    initEc() {
      var myChart = this.$echarts.init(this.$refs.aaa);

      // 指定图表的配置项和数据
      var option = {
        legend: {
          top:"center",
          left:"right",
          orient:'vertical'
        },
        series: [
          {
            name: "面积模式",
            type: "pie",
            radius: [10, 70],
            center: ["50%", "50%"],
            roseType: "area",
            itemStyle: {
              borderRadius: 8,
            },
            data: [
              { value: 40, name: "rose 1" },
              { value: 38, name: "rose 2" },
              { value: 32, name: "rose 3" },
              { value: 30, name: "rose 4" },
              { value: 28, name: "rose 5" },
              { value: 26, name: "rose 6" },
              { value: 22, name: "rose 7" },
              { value: 18, name: "rose 8" },
            ],
          },
        ],
      };

      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    },
  },
  mounted() {
    this.initEc();
  },
};
</script>

<style lang='scss' scoped>
.aaa {
  width: 500px;
  height: 223px;
//   border: 1px solid black;
}
</style>